package org.jeecg.modules.pipe.controller;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.config.TenantContext;
import org.jeecg.common.constant.DeviceConstant;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.SelectTreeModel;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.device.entity.DevDeviceInfo;
import org.jeecg.modules.pipe.entity.Section;
import org.jeecg.modules.pipe.service.ISectionService;
import org.jeecg.modules.pipe.vo.PipeMarkerVo;
import org.jeecg.modules.pipe.vo.PipeQueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;

/**
 * @Description: 管网管段
 * @Author: jeecg-boot
 * @Date:   2024-05-14
 * @Version: V1.0
 */
@Api(tags="管网管段")
@RestController
@RequestMapping("/pipe/section")
@Slf4j
public class SectionController extends JeecgController<Section, ISectionService> {
	@Autowired
	private ISectionService sectionService;
	@Autowired
	private RedisUtil redisUtil;

	/**
	 * 分页列表查询
	 *
	 * @param section
	 * @param pageNo
	 * @param pageSize
	 * @param req
	 * @return
	 */
	//@AutoLog(value = "管网管段-分页列表查询")
	@ApiOperation(value="管网管段-分页列表查询", notes="管网管段-分页列表查询")
	@GetMapping(value = "/rootList")
	public Result<IPage<Section>> queryPageList(Section section,
												@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
												@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
												HttpServletRequest req) {
		String hasQuery = req.getParameter("hasQuery");
		if(hasQuery != null && "true".equals(hasQuery)){
			QueryWrapper<Section> queryWrapper =  QueryGenerator.initQueryWrapper(section, req.getParameterMap());
			List<Section> list = sectionService.queryTreeListNoPage(queryWrapper);
			// for (Section section1 : list) {
			// 	if(redisUtil.hasKey(DeviceConstant.DEVICE_PIPE_SECTION_DATA + "::" + section1.getTenantId())){
			// 		PipeMarkerVo sectionMarkerVo = (PipeMarkerVo)redisUtil.hget(DeviceConstant.DEVICE_PIPE_SECTION_DATA + "::" + section1.getTenantId(), section1.getId());
			// 		if(null != sectionMarkerVo){
			// 			break;
			// 		}
			// 	}
			// 	setCache(section1);
			// }
			IPage<Section> pageList = new Page<>(1, 10, list.size());
			pageList.setRecords(list);
			return Result.OK(pageList);
		}else{
			String parentId = section.getPid();
			if (oConvertUtils.isEmpty(parentId)) {
				parentId = "0";
			}
			section.setPid(null);
			QueryWrapper<Section> queryWrapper = QueryGenerator.initQueryWrapper(section, req.getParameterMap());
			// 使用 eq 防止模糊查询
			queryWrapper.eq("pid", parentId);
			Page<Section> page = new Page<Section>(pageNo, pageSize);
			IPage<Section> pageList = sectionService.page(page, queryWrapper);
			return Result.OK(pageList);
		}
	}

	/**
	 * 【vue3专用】加载节点的子数据
	 *
	 * @param pid
	 * @return
	 */
	@RequestMapping(value = "/loadTreeChildren", method = RequestMethod.GET)
	public Result<List<SelectTreeModel>> loadTreeChildren(@RequestParam(name = "pid") String pid) {
		Result<List<SelectTreeModel>> result = new Result<>();
		try {
			List<SelectTreeModel> ls = sectionService.queryListByPid(pid);
			result.setResult(ls);
			result.setSuccess(true);
		} catch (Exception e) {
			e.printStackTrace();
			result.setMessage(e.getMessage());
			result.setSuccess(false);
		}
		return result;
	}

	/**
	 * 获取子数据
	 * @param section
	 * @param req
	 * @return
	 */
	//@AutoLog(value = "管网管段-获取子数据")
	@ApiOperation(value="管网管段-获取子数据", notes="管网管段-获取子数据")
	@GetMapping(value = "/childList")
	public Result<IPage<Section>> queryPageList(Section section,HttpServletRequest req) {
		QueryWrapper<Section> queryWrapper = QueryGenerator.initQueryWrapper(section, req.getParameterMap());
		List<Section> list = sectionService.list(queryWrapper);
		// for (Section section1 : list) {
		// 	if(redisUtil.hasKey(DeviceConstant.DEVICE_PIPE_SECTION_DATA + "::" + section1.getTenantId())){
		// 		Object obj = redisUtil.hget(DeviceConstant.DEVICE_PIPE_SECTION_DATA + "::" + section1.getTenantId(), section1.getId());
		// 		if(null != obj){
		// 			break;
		// 		}
		// 	}
		// 	setCache(section1);
		// }
		IPage<Section> pageList = new Page<>(1, 10, list.size());
		pageList.setRecords(list);
		return Result.OK(pageList);
	}

	/**
	 * 批量查询子节点
	 * @param parentIds 父ID（多个采用半角逗号分割）
	 * @return 返回 IPage
	 * @param parentIds
	 * @return
	 */
	//@AutoLog(value = "管网管段-批量获取子数据")
	@ApiOperation(value="管网管段-批量获取子数据", notes="管网管段-批量获取子数据")
	@GetMapping("/getChildListBatch")
	public Result getChildListBatch(@RequestParam("parentIds") String parentIds) {
		try {
			QueryWrapper<Section> queryWrapper = new QueryWrapper<>();
			List<String> parentIdList = Arrays.asList(parentIds.split(","));
			queryWrapper.in("pid", parentIdList);
			List<Section> list = sectionService.list(queryWrapper);
			IPage<Section> pageList = new Page<>(1, 10, list.size());
			pageList.setRecords(list);
			return Result.OK(pageList);
		} catch (Exception e) {
			log.error(e.getMessage(), e);
			return Result.error("批量查询子节点失败：" + e.getMessage());
		}
	}

	/**
	 *   添加
	 *
	 * @param section
	 * @return
	 */
	@AutoLog(value = "管网管段-添加")
	@ApiOperation(value="管网管段-添加", notes="管网管段-添加")
	@RequiresPermissions("pipe:iot_pipe_pipe_section:add")
	@PostMapping(value = "/add")
	public Result<String> add(@RequestBody Section section) {
		sectionService.addSection(section);

		PipeMarkerVo markerVo = new PipeMarkerVo();
		markerVo.setId(section.getId()+"");
		markerVo.setName(section.getName());
		markerVo.setBeginLong(section.getBeginLong());
		markerVo.setBeginLat(section.getBeginLat());
		markerVo.setLongitude(section.getEndLong());
		markerVo.setLatitude(section.getEndLat());
		markerVo.setPaths(section.getPaths());
		markerVo.setType("5");
		markerVo.setColor(section.getPipeColor());
		markerVo.setStatus(section.getStatus()+"");
		markerVo.setParentId(null != section.getPid() ? section.getPid()+"" : null);

		// 当前租户
		String tenantId = oConvertUtils.getString(TenantContext.getTenant(), "0");

		redisUtil.sSet(DeviceConstant.DEVICE_PIPE_SECTION_SET+"::"+tenantId,section.getId()+"");
		redisUtil.hset(DeviceConstant.DEVICE_PIPE_SECTION_DATA+"::"+tenantId,section.getId()+"",markerVo);

		return Result.OK("添加成功！");
	}

	/**
	 *  编辑
	 *
	 * @param section
	 * @return
	 */
	@AutoLog(value = "管网管段-编辑")
	@ApiOperation(value="管网管段-编辑", notes="管网管段-编辑")
	@RequiresPermissions("pipe:iot_pipe_pipe_section:edit")
	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
	public Result<String> edit(@RequestBody Section section) {
		sectionService.updateSection(section);

		PipeMarkerVo markerVo = new PipeMarkerVo();
		markerVo.setId(section.getId()+"");
		markerVo.setName(section.getName());
		markerVo.setBeginLong(section.getBeginLong());
		markerVo.setBeginLat(section.getBeginLat());
		markerVo.setLongitude(section.getEndLong());
		markerVo.setLatitude(section.getEndLat());
		markerVo.setPaths(section.getPaths());
		markerVo.setType("5");
		markerVo.setColor(section.getPipeColor());
		markerVo.setStatus(section.getStatus()+"");
		markerVo.setParentId(null != section.getPid() ? section.getPid()+"" : null);

		// 当前租户
		String tenantId = oConvertUtils.getString(TenantContext.getTenant(), "0");
		redisUtil.setRemove(DeviceConstant.DEVICE_PIPE_SECTION_SET+"::"+tenantId,section.getId()+"");
		redisUtil.sSet(DeviceConstant.DEVICE_PIPE_SECTION_SET+"::"+tenantId,section.getId()+"");
		redisUtil.hset(DeviceConstant.DEVICE_PIPE_SECTION_DATA+"::"+tenantId,section.getId()+"",markerVo);

		return Result.OK("编辑成功!");
	}

	/**
	 *   通过id删除
	 *
	 * @param id
	 * @return
	 */
	@AutoLog(value = "管网管段-通过id删除")
	@ApiOperation(value="管网管段-通过id删除", notes="管网管段-通过id删除")
	@RequiresPermissions("pipe:iot_pipe_pipe_section:delete")
	@DeleteMapping(value = "/delete")
	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
		sectionService.deleteSection(id);
		// 当前租户
		String tenantId = oConvertUtils.getString(TenantContext.getTenant(), "0");
		redisUtil.setRemove(DeviceConstant.DEVICE_PIPE_SECTION_SET+"::"+tenantId,id);
		redisUtil.hdel(DeviceConstant.DEVICE_PIPE_SECTION_DATA+"::"+tenantId,id);

		return Result.OK("删除成功!");
	}

	// /**
	//  *  批量删除
	//  *
	//  * @param ids
	//  * @return
	//  */
	// @AutoLog(value = "管网管段-批量删除")
	// @ApiOperation(value="管网管段-批量删除", notes="管网管段-批量删除")
	// @RequiresPermissions("pipe:iot_pipe_pipe_section:deleteBatch")
	// @DeleteMapping(value = "/deleteBatch")
	// public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	// 	this.sectionService.removeByIds(Arrays.asList(ids.split(",")));
	// 	return Result.OK("批量删除成功！");
	// }

	/**
	 * 通过id查询
	 *
	 * @param id
	 * @return
	 */
	//@AutoLog(value = "管网管段-通过id查询")
	@ApiOperation(value="管网管段-通过id查询", notes="管网管段-通过id查询")
	@GetMapping(value = "/queryById")
	public Result<Section> queryById(@RequestParam(name="id",required=true) String id) {
		Section section = sectionService.getById(id);
		if(section==null) {
			return Result.error("未找到对应数据");
		}
		return Result.OK(section);
	}

	/**
	 * 导出excel
	 *
	 * @param request
	 * @param section
	 */
	@RequiresPermissions("pipe:iot_pipe_pipe_section:exportXls")
	@RequestMapping(value = "/exportXls")
	public ModelAndView exportXls(HttpServletRequest request, Section section) {
		return super.exportXls(request, section, Section.class, "管网管段");
	}

	/**
	 * 通过excel导入数据
	 *
	 * @param request
	 * @param response
	 * @return
	 */
	@RequiresPermissions("pipe:iot_pipe_pipe_section:importExcel")
	@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
	public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
		return super.importExcel(request, response, Section.class);
	}
	
	// /**
	//  * 分页列表查询
	//  *
	//  * @param section
	//  * @param pageNo
	//  * @param pageSize
	//  * @param req
	//  * @return
	//  */
	// //@AutoLog(value = "管网管段-分页列表查询")
	// @ApiOperation(value="管网管段-分页列表查询", notes="管网管段-分页列表查询")
	// @GetMapping(value = "/list")
	// public Result<IPage<Section>> queryPageList(Section section,
	// 							   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
	// 							   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
	// 							   HttpServletRequest req) {
	// 	QueryWrapper<Section> queryWrapper = QueryGenerator.initQueryWrapper(section, req.getParameterMap());
	// 	Page<Section> page = new Page<Section>(pageNo, pageSize);
	// 	IPage<Section> pageList = sectionService.page(page, queryWrapper);
	//
	// 	if(null != pageList.getRecords() && pageList.getRecords().size()>0){
	// 		for (Section record : pageList.getRecords()) {
	// 			setCache(record);
	// 		}
	// 	}
	// 	return Result.OK(pageList);
	// }
	//
	// /**
	//  *   添加
	//  *
	//  * @param section
	//  * @return
	//  */
	// @AutoLog(value = "管网管段-添加")
	// @ApiOperation(value="管网管段-添加", notes="管网管段-添加")
	// // @RequiresPermissions("pipe:iot_pipe_pipe_section:add")
	// @PostMapping(value = "/add")
	// public Result<String> add(@RequestBody Section section) {
	// 	sectionService.saveSection(section);
	//
	// 	/**
	// 	 *   Select id,name,begin_long as 'beginLong',begin_lat as 'beginLat',
	// 	 *   end_long as 'longitude',end_lat as 'latitude',
	// 	 *     paths,'5' as 'type',pipe_color as 'color', status
	// 	 *
	// 	 */
	//
	// 	PipeMarkerVo markerVo = new PipeMarkerVo();
	// 	markerVo.setId(section.getId()+"");
	// 	markerVo.setName(section.getName());
	// 	markerVo.setBeginLong(section.getBeginLong());
	// 	markerVo.setBeginLat(section.getBeginLat());
	// 	markerVo.setLongitude(section.getEndLong());
	// 	markerVo.setLatitude(section.getEndLat());
	// 	markerVo.setPaths(section.getPaths());
	// 	markerVo.setType("5");
	// 	markerVo.setColor(section.getPipeColor());
	// 	markerVo.setStatus(section.getStatus()+"");
	// 	markerVo.setParentId(null != section.getPid() ? section.getPid()+"" : null);
	//
	// 	// 当前租户
	// 	String tenantId = oConvertUtils.getString(TenantContext.getTenant(), "0");
	//
	// 	redisUtil.sSet(DeviceConstant.DEVICE_PIPE_SECTION_SET+"::"+tenantId,section.getId()+"");
	// 	redisUtil.hset(DeviceConstant.DEVICE_PIPE_SECTION_DATA+"::"+tenantId,section.getId()+"",markerVo);
	//
	// 	return Result.OK("添加成功！");
	// }
	//
	// /**
	//  *  编辑
	//  *
	//  * @param section
	//  * @return
	//  */
	// @AutoLog(value = "管网管段-编辑")
	// @ApiOperation(value="管网管段-编辑", notes="管网管段-编辑")
	// // @RequiresPermissions("pipe:iot_pipe_pipe_section:edit")
	// @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
	// public Result<String> edit(@RequestBody Section section) {
	// 	sectionService.saveSection(section);
	//
	// 	PipeMarkerVo markerVo = new PipeMarkerVo();
	// 	markerVo.setId(section.getId()+"");
	// 	markerVo.setName(section.getName());
	// 	markerVo.setBeginLong(section.getBeginLong());
	// 	markerVo.setBeginLat(section.getBeginLat());
	// 	markerVo.setLongitude(section.getEndLong());
	// 	markerVo.setLatitude(section.getEndLat());
	// 	markerVo.setPaths(section.getPaths());
	// 	markerVo.setType("5");
	// 	markerVo.setColor(section.getPipeColor());
	// 	markerVo.setStatus(section.getStatus()+"");
	// 	markerVo.setParentId(null != section.getPid() ? section.getPid()+"" : null);
	//
	// 	// 当前租户
	// 	String tenantId = oConvertUtils.getString(TenantContext.getTenant(), "0");
	// 	redisUtil.setRemove(DeviceConstant.DEVICE_PIPE_SECTION_SET+"::"+tenantId,section.getId()+"");
	// 	redisUtil.sSet(DeviceConstant.DEVICE_PIPE_SECTION_SET+"::"+tenantId,section.getId()+"");
	// 	redisUtil.hset(DeviceConstant.DEVICE_PIPE_SECTION_DATA+"::"+tenantId,section.getId()+"",markerVo);
	//
	// 	return Result.OK("编辑成功!");
	// }
	//
	// /**
	//  *
	//  *   通过id删除
	//  *
	//  * @param id
	//  * @return
	//  */
	// @AutoLog(value = "管网管段-通过id删除")
	// @ApiOperation(value="管网管段-通过id删除", notes="管网管段-通过id删除")
	// // @RequiresPermissions("pipe:iot_pipe_pipe_section:delete")
	// @DeleteMapping(value = "/delete")
	// public Result<String> delete(@RequestParam(name="id",required=true) String id) {
	// 	sectionService.removeById(id);
	// 	return Result.OK("删除成功!");
	// }
	//
	// /**
	//  *  批量删除
	//  *
	//  * @param ids
	//  * @return
	//  */
	// @AutoLog(value = "管网管段-批量删除")
	// @ApiOperation(value="管网管段-批量删除", notes="管网管段-批量删除")
	// // @RequiresPermissions("pipe:iot_pipe_pipe_section:deleteBatch")
	// @DeleteMapping(value = "/deleteBatch")
	// public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	// 	this.sectionService.removeByIds(Arrays.asList(ids.split(",")));
	// 	return Result.OK("批量删除成功!");
	// }
	//
	// /**
	//  * 通过id查询
	//  *
	//  * @param id
	//  * @return
	//  */
	// //@AutoLog(value = "管网管段-通过id查询")
	// @ApiOperation(value="管网管段-通过id查询", notes="管网管段-通过id查询")
	// @GetMapping(value = "/queryById")
	// public Result<Section> queryById(@RequestParam(name="id",required=true) String id) {
	// 	Section section = sectionService.getById(id);
	// 	if(section==null) {
	// 		return Result.error("未找到对应数据");
	// 	}
	// 	return Result.OK(section);
	// }
	//
    // /**
    // * 导出excel
    // *
    // * @param request
    // * @param section
    // */
    // // @RequiresPermissions("pipe:iot_pipe_pipe_section:exportXls")
    // @RequestMapping(value = "/exportXls")
    // public ModelAndView exportXls(HttpServletRequest request, Section section) {
    //     return super.exportXls(request, section, Section.class, "管网管段");
    // }
	//
    // /**
    //   * 通过excel导入数据
    // *
    // * @param request
    // * @param response
    // * @return
    // */
    // // @RequiresPermissions("pipe:iot_pipe_pipe_section:importExcel")
    // @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    // public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
    //     return super.importExcel(request, response, Section.class);
    // }

	/**
	 * 获取管段列表查询
	 *
	 * @param queryVo
	 * @return
	 */
	//@AutoLog(value = "水厂信息表-分页列表查询")
	@ApiOperation(value="管段列表查询", notes="管段列表查询")
	@GetMapping(value = "/api/getList")
	public Result<List<PipeMarkerVo>> getList(PipeQueryVo queryVo) {
		List<PipeMarkerVo> list = sectionService.getSectionMarker(queryVo);
		return Result.OK(list);
	}

	/**
	 * 获取管网Marker
	 *
	 * @param queryVo
	 * @return
	 */
	//@AutoLog(value = "水厂信息表-分页列表查询")
	@ApiOperation(value="获取管网Marker", notes="获取管网Marker")
	@GetMapping(value = "/api/getPipeMarker")
	public Result<List<PipeMarkerVo>> getPipeMarker(PipeQueryVo queryVo) {
		List<PipeMarkerVo> list = sectionService.getPipeMarker(queryVo);
		return Result.OK(list);
	}

	/**
	 * 管网关阀-下流影响演示
	 *
	 * @param queryVo
	 * @return
	 */
	//@AutoLog(value = "水厂信息表-分页列表查询")
	@ApiOperation(value="获取管网Marker", notes="获取管网Marker")
	@PostMapping(value = "/api/pipeCloseFlow")
	public Result<String> pipeCloseFlow(@RequestBody PipeQueryVo queryVo) {
		String msg = sectionService.pipeCloseFlow(queryVo);
		return Result.OK(msg);
	}

	/**
	 * 管网漏损-地图演示
	 *
	 * @param queryVo
	 * @return
	 */
	//@AutoLog(value = "水厂信息表-分页列表查询")
	@ApiOperation(value="管网漏损", notes="管网漏损")
	@PostMapping(value = "/api/pipeFlowLeakage")
	public Result<?> pipeFlowLeakage(@RequestBody PipeQueryVo queryVo) {
		List<PipeMarkerVo> pipeMarkerVos = sectionService.pipeFlowLeakage(queryVo);
		// return Result.OK(JSON.toJSONString(pipeMarkerVos));
		return Result.OK(pipeMarkerVos);
	}

	/**
	 * 通过id获取管段接口
	 *
	 * @param id
	 * @return
	 */
	//@AutoLog(value = "水厂-通过id查询")
	@ApiOperation(value="管段-通过id查询", notes="管段-通过id查询")
	@GetMapping(value = "/api/querySection/{id}")
	public Result<Section> queryPump(@PathVariable("id") String id) {
		Section waterPlant = sectionService.getById(id);
		if(waterPlant==null) {
			return Result.error("未找到对应数据");
		}

		String redisKey = String.format("sys:cache:dict::%s:%s", "facility_types", waterPlant.getFacilityTypes());
		try {
			String facilityTypes =  oConvertUtils.getString(redisUtil.get(redisKey));
			waterPlant.setFacilityTypes(facilityTypes);
			redisKey = String.format("sys:cache:dict::%s:%s", "pipe_diameter", waterPlant.getPipeDiameter());
			String pipeDiameter =  oConvertUtils.getString(redisUtil.get(redisKey));
			waterPlant.setPipeDiameter(pipeDiameter);
			redisKey = String.format("sys:cache:dict::%s:%s", "pipe_type", waterPlant.getPipeType());
			String pipeType =  oConvertUtils.getString(redisUtil.get(redisKey));
			waterPlant.setPipeType(pipeType);
		} catch (Exception e) {
			log.warn(e.getMessage(), e);
		}
		return Result.OK(waterPlant);
	}

	public void setCache(Section section){
		PipeMarkerVo markerVo = new PipeMarkerVo();
		markerVo.setId(section.getId()+"");
		markerVo.setName(section.getName());
		markerVo.setBeginLong(section.getBeginLong());
		markerVo.setBeginLat(section.getBeginLat());
		markerVo.setLongitude(section.getEndLong());
		markerVo.setLatitude(section.getEndLat());
		markerVo.setPaths(section.getPaths());
		markerVo.setType("5");
		markerVo.setColor(section.getPipeColor());
		markerVo.setStatus(section.getStatus()+"");
		markerVo.setParentId(null != section.getPid() ? section.getPid()+"" : null);

		// 当前租户
		String tenantId = oConvertUtils.getString(TenantContext.getTenant(), "0");
		redisUtil.setRemove(DeviceConstant.DEVICE_PIPE_SECTION_SET+"::"+tenantId,section.getId()+"");
		redisUtil.sSet(DeviceConstant.DEVICE_PIPE_SECTION_SET+"::"+tenantId,section.getId()+"");
		redisUtil.hset(DeviceConstant.DEVICE_PIPE_SECTION_DATA+"::"+tenantId,section.getId()+"",markerVo);
	}

}
